<script setup lang="ts">
defineProps<{
  money: number;
}>();
// const emit = defineEmits(['play', 'add'])
const emit = defineEmits<{
  (e: "play", data: number): void;
  (e: "add", data: number): void;
}>();
const play = () => {
  emit("play", 10);
};
const serder = () => {
  let str = "10";
  emit("add", 60);
};
</script>

<template>
  <h4>{{ money }}</h4>
  <button @click="play">花钱</button>
  <button @click="serder">赚钱</button>
</template>

<style scoped></style>
1
